package cn.tlb.gl.game.rebuild3;

import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.MotionEvent;

import cn.tlb.BaseGLActivity;

public class GameActivity extends BaseGLActivity {

    private NewModelRenderer renderer;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        renderer = new NewModelRenderer(this);
        renderer.setTextureStream(getResources().openRawResource(getIntent().getIntExtra("id",0)));
        mGlSurfaceView = new GLSurfaceView(this);
        mGlSurfaceView.setRenderer(renderer);
        setContentView(mGlSurfaceView);
    }

    @Override
    public boolean onTouchEvent(MotionEvent e) {
        super.onTouchEvent(e);
        renderer.setAngleX(mAngleX);
        renderer.setAngleY(mAngleY);
        return true;
    }
}
